package com.dzqc.fly.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dzqc.fly.db.dao.SecretaryHomeDao;
import com.dzqc.fly.db.dao.SecretaryQueryDao;
import com.dzqc.fly.db.pojo.SecretaryHomePojo;
import com.dzqc.fly.db.pojo.StudentsLeavePojo;
import com.dzqc.fly.db.pojo.StudentsLeaveShenPiPojo;
import com.dzqc.fly.service.SecretaryHomeService;
import com.dzqc.fly.service.SecretaryQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author hlp
 */
@Service
public class SecretaryHomeServiceImpl extends ServiceImpl<SecretaryHomeDao, SecretaryHomePojo> implements SecretaryHomeService {
    @Autowired
    private SecretaryHomeDao secretaryHomeDao;

    @Override
    public Page<SecretaryHomePojo> searchSecretaryHome(HashMap param) {
        Page<SecretaryHomePojo> page = new Page<>((Integer) param.get("current"),(Integer) param.get("size"));
        List<SecretaryHomePojo> pojoList = secretaryHomeDao.searchSecretaryHome(page,param);
        return page.setRecords(pojoList);
    }

    @Override
    public StudentsLeaveShenPiPojo searchSecretaryHomeDetail(HashMap param) {
        StudentsLeaveShenPiPojo pojo = secretaryHomeDao.searchSecretaryHomeDetail(param);
        return pojo;
    }

    @Override
    public Integer updateShenPi(HashMap param) {
        return secretaryHomeDao.updateShenPi(param);
    }

}
